<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Sites</title>
<link href="../css/admin.css" rel="stylesheet" type="text/css" />
<script src="../js/jquery-1.5.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
	$(function () {
		$('.commonTable tr').hover(function () {
			$(this).css('background-color', '#ffffae');
		},
        function () {
        	$(this).css('background-color', '#FFFFFF');
        });
       });
	function addSite()
	{
		window.location = "add_site.php";
	}
	function delsite(sid)
	{
		if(confirm('确定删除？'))
			window.location = "sites.php?del=" + sid;
	}
</script>
</head>
<body>
	<div class="listTitle">网站管理</div>
	<div class="btnDiv"><input type="button" value="添加网站" onclick="addSite()" />&nbsp;&nbsp;<input type="button" value="排序" onclick="sortSite()" /></div>
	<div><table class="commonTable" width="100%" cellspacing="0" cellpadding="5" >
	    <tr>
		    <th>名称</th>
			<th>描述</th>
			<th>网址</th>
			<th>状态</th>
		    <th width="60" >
		    </th>
	    </tr>
		<?php
if(!empty($del))
{
	$dsql->SetQuery("delete from `#@__site` where sid='$del'");
	$dsql->Execute();//->ExecNoneQuery($del);
}
			$dsql->SetQuery("SELECT * FROM `#@__site` order by sortno,updatetime ");//WHERE `sitestatus` = '0'");
			$dsql->Execute();
			while ($row = $dsql->GetArray())
			{?>
			<tr>
			<td><?=$row['sname']?></td>
			<td><?=$row['description']?></td>
			<td><?=$row['surl']?></td>
			<!-- <td><?=$row['htmlpath']?></td> -->
			<td><?=$row['sitestatus']==0?"启用":"禁用"?></td>
			<td><a href="add_site.php?sid=<?=$row['sid']?>">编辑</a>&nbsp;<a href="javascript:delsite('<?=$row['sid']?>') ">删除</a></td>
			</tr>
		<?php
			}
		?>
	</table></div>
</body>
</html>